package nxu.it.movieapi.util;

import nxu.it.api.common.result.ApiResult;
import nxu.it.movieapi.enums.ResponseType;

public class ApiResultUtils {
    public static <T> ApiResult<T> failure(String message) {
        ApiResult<T> apiResult = new ApiResult<>();
        apiResult.setCode(ResponseType.FAILURE.getCode());
        apiResult.setSuccess(false);
        apiResult.setMessage(message != null ? message : ResponseType.FAILURE.getMessage());
        return apiResult;
    }
}

